package com.yuanfeng.business.controller;


import com.yuanfeng.business.dto.ShopHelpQueryDTO;
import com.yuanfeng.commoms.util.ResponseResult;
import io.seata.core.exception.TransactionException;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * (ShopJoinBase)
 *
 * @since 2023-05-19 15:35:47
 */
@RestController
@RequestMapping("shop/joinBase")
public class ShopJoinBaseController extends BaseController{



    /**
     * 查询入驻情况
     * @param param
     * @return
     */
    @PostMapping("queryAgree")
    public ResponseResult shopJoinAgree(@RequestBody Map<String,Object> param) {
        return shopJoinBaseService.shopJoinAgree(param);
    }

    /**
     * 店铺入驻-插入
     *
     * @param param
     * @return
     */
    @PostMapping("/insert")
    public ResponseResult insertShopJoinBase(@RequestBody Map<String,Object> param) throws TransactionException {
        return shopJoinBaseService.insertShopJoinBase(param);
    }

    /**
     * 店铺入驻-更新
     *
     * @param param
     * @return
     */
    @PostMapping("/update")
    public ResponseResult updateShopJoinBase(@RequestBody Map<String,Object> param) {
        return shopJoinBaseService.updateShopJoinBase(param);
    }

    /**
     * 店铺入驻-查询
     *
     * @param param
     * @return
     */
    @PostMapping("/query")
    public ResponseResult queryShopJoinBase(@RequestBody Map<String,Object> param) {
        return shopJoinBaseService.queryShopJoinBase(param);
    }

    /**
     * 店铺入驻-查询支付凭证
     *
     * @param param
     * @return
     */
    @PostMapping("/pay/query")
    public ResponseResult queryPayEvidence(@RequestBody Map<String,Object> param) {
        return shopJoinBaseService.queryPayEvidence(param);
    }

    /**
     * 查询店铺帮助信息
     *
     * @param param
     * @return
     */
    @PostMapping("/queryShopHelp")
    public ResponseResult queryShopHelp(@RequestBody ShopHelpQueryDTO param) {
        return shopJoinBaseService.queryShopHelp(param);
    }

    /**
     * 校验公司名称是否重复
     *
     * @param param
     * @return
     */
    @PostMapping("/companyName/check")
    public ResponseResult checkCompanyName(@RequestBody Map<String,Object> param) {
        return shopJoinBaseService.checkCompanyName(param);
    }

    /**
     * 校验手机号是否已注册
     *
     * @param param
     * @return
     */
    @PostMapping("/phone/check")
    public ResponseResult checkPhoneNumber(@RequestBody Map<String,Object> param) {
        return shopJoinBaseService.checkPhoneNumber(param);
    }

    /**
     * 平台-查看店铺信息
     *
     * @param param
     * @return
     */
    @PostMapping("/platform/queryShopJoinDetail")
    public ResponseResult queryShopJoinDetailForPlatform(@RequestBody Map<String,Object> param) {
        ResponseResult result=shopJoinBaseService.queryShopJoinDetailForPlatform(param);
        return result;
    }

    /**
     * 商家后台-开户银行
     *
     * @param param
     * @return
     */
    @PostMapping("/queryBank")
    public ResponseResult queryShopJoinBaseBankForSeller(@RequestBody Map<String, Object> param) {
        return shopJoinBaseService.queryShopJoinBaseBankForSeller(param);
    }

    /**
     * 商家后台-店铺信息
     *
     * @param param
     * @return
     */
    @PostMapping("/queryShopInfo")
    public ResponseResult queryShopJoinBaseForSeller(@RequestBody Map<String,Object> param) {
        return shopJoinBaseService.queryShopJoinBaseForSeller(param);
    }

    /**
     * 商家后台-店铺资质
     *
     * @param param
     * @return
     */
    @PostMapping("/qualiQuery")
    public ResponseResult queryShopJoinBaseQualiForSeller(@RequestBody Map<String,Object> param) {
        return shopJoinBaseService.queryShopJoinBaseQualiForSeller(param);
    }

    /**
     * 平台-审核店铺资质详情
     *
     * @param param
     * @return
     */
    @PostMapping("/updateForSeller")
    public ResponseResult updateShopJoinBaseForSeller(@RequestBody Map<String,Object> param) {
        return shopJoinBaseService.updateShopJoinBaseForSeller(param);
    }

    /**
     * 商户后台-修改银行卡信息
     *
     * @param param
     * @return
     */
    @PostMapping("/bankInfo/update")
    public ResponseResult updateShopJoinBankInfoForSeller(@RequestBody Map<String,Object> param) {
        return shopJoinBaseService.updateShopJoinBankInfoForSeller(param);
    }

    /**
     * 商户入驻-同意协议
     *
     * @param param
     * @return
     */
    @PostMapping("/agree")
    public ResponseResult shopAgree(@RequestBody Map<String,Object> param) {
        return shopJoinBaseService.shopAgree(param);
    }

    /**
     * 店铺入驻-平台审核入驻信息
     *
     * @param param
     * @return
     */

    @PostMapping("/platform/audit")
    public ResponseResult auditShopJoinBase(@RequestBody Map<String, Object> param) throws TransactionException {
        ResponseResult results = shopJoinBaseService.auditShopJoinBase(param);
        return results;
    }

    /**
     * 店铺入驻-平台查询详情
     *
     * @param param
     * @return
     */
    @PostMapping("/platform/query/detail")
    public ResponseResult queryShopJoinBaseDetailForPlatform(@RequestBody Map<String, Object> param) {
        ResponseResult results = shopJoinBaseService.queryShopJoinBaseDetailForPlatform(param);
        return results;
    }


    /**
     * 店铺入驻-平台查询列表
     *
     * @param param
     * @return
     */
    @PostMapping("/platform/query")
    public ResponseResult queryShopJoinBaseForPlatform(@RequestBody Map<String, Object> param) {
        ResponseResult results = shopJoinBaseService.queryShopJoinBaseForPlatform(param);
        return results;
    }
}

